home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-03 | 1.3 KB | 87 lines | [TEXT/MPS ] |
- #
- # MPW Shell script to create MPW marks for all procedures,
- # records, global and link statements.
- #
-
- #
- # Set up.
- #
- set Exit 0
- if "{1}" == "-y"
- set y 1
- shift
- else
- set y 0
- end
- if {#} == 0
- set 1 "{Target}"
- end
- open "{1}"
- if {Status}
- alert "Can∂'t find ∂"{1}∂"."
- exit
- end
- #
- # Delete existing markers, with his permission.
- #
- set marks "`markers "{1}"`"
- if {y}
- unmark {marks} "{1}"
- else
- if "{marks}" != ""
- confirm -t "Delete existing marks?"
- exit if {Status} == 5
- if {Status} == 0
- unmark {marks} "{1}"
- end
- end
- end
- #
- # Mark procedures.
- #
- find • "{1}"
- loop
- find /•[ ∂t]*procedure[ ∂t]+/ "{1}"
- break if {Status}
- find /[a-zA-Z0-9_]+/ "{1}"
- mark § "`catenate "{1}.§"`" "{1}"
- end
- #
- # Mark records.
- #
- find • "{1}"
- loop
- find /•[ ∂t]*record[ ∂t]+/ "{1}"
- break if {Status}
- find /[a-zA-Z0-9_]+/ "{1}"
- mark § "`catenate "{1}.§"`" "{1}"
- end
- #
- # Mark globals.
- #
- set count ''
- find • "{1}"
- loop
- find /•[ ∂t]*global[ ∂t]+/ "{1}"
- break if {Status}
- find Δ§:/global/ "{1}"
- mark § "global {count}" "{1}"
- evaluate count += 1
- end
- #
- # Mark links.
- #
- set count ''
- find • "{1}"
- loop
- find /•[ ∂t]*link[ ∂t]+/ "{1}"
- break if {Status}
- find Δ§:/link/ "{1}"
- mark § "link {count}" "{1}"
- evaluate count += 1
- end
- #
- # All done -- position at start of file.
- #
- find • "{1}"
-